<ng-template #extra>
    <button nz-button (click)="handleCancel()" style="margin-right: 10px">
        取消
    </button>
    <button nz-button nzType="primary" (click)="submit()">
        <i nz-icon nzType="save" nzTheme="outline"></i>
        保存
    </button>
</ng-template>

<nz-card [nzTitle]="id ? '编辑检查信息' : '创建检查信息'" [nzExtra]="extra">
    <form nz-form [formGroup]="group" (ngSubmit)="submit()">
        <!-- <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="id">id</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="id" />
            </nz-form-control>
        </nz-form-item> -->

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="expression"
            >表达式
            </nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="expression"/>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="product_id"
            >产品id
            </nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="">
                <nz-select
                    formControlName="product_id"
                    [nzOptions]="productList"
                >
                </nz-select>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="template"
            >模板
            </nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="template"/>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="title"
            >标题
            </nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="title"/>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="type"
            >类型
            </nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="">
                <input nz-input formControlName="type"/>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="delay"
            >报警延迟s
            </nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24">

                <nz-input-number-group nzAddOnAfter="秒">
                    <nz-input-number
                        formControlName="delay"
                        [nzMin]="1"
                        [nzStep]="1"
                    ></nz-input-number>
                </nz-input-number-group>

            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="repeat">再次提醒</nz-form-label>
            <nz-switch formControlName="repeat"></nz-switch>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="repeat_delay">再次提醒间隔
            </nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <nz-input-number-group nzAddOnAfter="秒">
                    <nz-input-number
                        formControlName="repeat_delay"
                        [nzMin]="1"
                        [nzStep]="1"
                    ></nz-input-number>
                </nz-input-number-group>

            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="repeat_total">重复提醒次数</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <nz-input-number-group nzAddOnAfter="次">
                    <nz-input-number
                        formControlName="repeat_total"
                        [nzMin]="1"
                        [nzStep]="1"
                    ></nz-input-number>
                </nz-input-number-group>

            </nz-form-control>
        </nz-form-item>


        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="level"
            >等级
            </nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24">

                <nz-input-number-group nzAddOnAfter="级">
                    <nz-input-number
                        formControlName="level"
                        [nzMin]="1"
                        [nzStep]="1"
                    ></nz-input-number>

                </nz-input-number-group>


            </nz-form-control>
        </nz-form-item>
    </form>


</nz-card>
